package com.chen.librarysystem.test;

import com.chen.librarysystem.context.AppContext;
import com.chen.librarysystem.controller.BookController;
import com.chen.librarysystem.log.LibraryLog;
import com.chen.librarysystem.util.PrintUtils;

import java.util.logging.Level;

/**
 * 测试图书管理系统 入口类
 */
public class TestStudentSystem {
    private static final BookController controller = new BookController();

    public static void main(String[] args) {
        System.out.println("欢迎来到图书管理系统");
        while (true) {
            System.out.println("==========图书管理系统==============");
            System.out.println("1. 注册");
            System.out.println("2. 登录");
            System.out.println("3. 退出系统");
            int type = PrintUtils.getIntInput(AppContext.getInstance().getScanner(), "请输入您的选择:");
            switch (type) {
                case 1:
                    controller.register();
                    LibraryLog.log(Level.INFO, "注册");
                    break;
                case 2:
                    controller.login();
                    LibraryLog.log(Level.INFO, "登录");
                    break;
                case 3:
                    System.out.println("谢谢使用!");
                    LibraryLog.log(Level.INFO, "退出系统");
                    return;
            }
        }
    }
}
